import request from '@/utils/request'
export default {
    //分页课程查询
    getCourseList(page, limit, searchObj) {
        return request({
            url: `/eduservice/coursefront/getFrontCourseList/${page}/${limit}`,
            method: 'post',
            data: searchObj
        })
    },
    //查询所有的分类
    getAllSubject() {
        return request({
            url: `/eduservice/subject/getAllSubject`,
            method: 'get'
        })
    },
    //查询课程的详细信息
    getCourseInfo(courseId) {
        return request({
            url: `/eduservice/coursefront/getFrontCourseInfo/${courseId}`,
            method: 'get'
        })
    },
    //查看课程的所有评论
    getCourseComment(courseId, page, limit) {
        return request({
            url: `/eduservice/educomment/getAllComment/${courseId}/${page}/${limit}`,
            method: 'get'
        })
    },
    //根据token值获取用户信息
    getLoginUserInfo() {

        return request({
            url: '/eduservice/educomment/getMemberInfo',
            method: 'get'
        })
    },
    //添加评论
    addComment(commentInfo) {
        return request({
            url: '/eduservice/educomment/addEduComment',
            method: 'post',
            data: commentInfo
        })
    }
}